package com.yl.module.property.domain.dto;


import com.fasterxml.jackson.annotation.JsonFormat;
import com.yl.common.core.validate.Group;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.List;

/**
 * 资产维修记录表 DTO
 * @author makejava
 * @date 2024-10-23 15:54:16
 */
@Data
@ApiModel(value = "PropertyUpkeepAddOrUpdDTO", description = "")
public class PropertyUpkeepAddOrUpdDTO implements Serializable {
	private static final long serialVersionUID = 701124741048199346L;

	@ApiModelProperty(value = "资产维修记录表-主键id")
	@NotNull(message = "参数id 不能为空" , groups = {Group.Upd.class })
	@Min(value = 1, message = "参数id 不能为0" , groups = {Group.Upd.class })
	private Long id;

	@ApiModelProperty(value = "资产一级分类id 1家电 2安消 3家具 4构件")
	@NotNull(message = "参数propertyTypeId 不能为空", groups = {Group.Add.class, Group.Upd.class})
	@Min(value = 1, message = "参数propertyTypeId 不能为空", groups = {Group.Add.class, Group.Upd.class})
	private Integer propertyTypeId;

	@ApiModelProperty(value = "资产id 来源property.id")
	@NotNull(message = "参数propertyId 不能为空" , groups = {Group.Add.class})
	@Min(value = 1, message = "参数propertyId 不能为0" , groups = {Group.Add.class})
	private Integer propertyId;

	@ApiModelProperty(value = "描述")
	@NotBlank(message = "参数describe 不能为空", groups = { Group.Add.class, Group.Upd.class})
	private String describe;

	@ApiModelProperty(value = "维修时间")
	@NotNull(message = "参数upkeepTime 不能为空" , groups = {Group.Add.class, Group.Upd.class})
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	private LocalDateTime upkeepTime;

	@ApiModelProperty(value = "资产维修文件 文件id")
	private List<Long> fileIds;
}

